package com.wushijia;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableOAuth2Client;
import org.springframework.web.client.RestTemplate;

/**
 * description:先获取token,在访问路径
 *
 * @author yang
 * @date 2018/5/17 17:46
 */
@SpringBootApplication
@EnableOAuth2Client
@ServletComponentScan //druid连接池需要
public class AuthenticationApplication {

  public static void main(String[] args) {
    System.out.println("{bcrypt}" + new BCryptPasswordEncoder().encode("123456"));
    SpringApplication.run(AuthenticationApplication.class, args);
  }

  @Bean
  public RestTemplate restTemplate() {
    return new RestTemplate();
  }

}
